﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.Services;
using Netcare.Core;

namespace Netcare.Web.Services
{
    /// <summary>
    /// Summary description for MySql
    /// </summary>
    [WebService(Namespace = "http://www.wicresoft.com/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]
    public class MySql : System.Web.Services.WebService
    {
        [WebMethod]
        public string HelloWorld()
        {
            return "Hello World";
        }

        [WebMethod]
        public MySqlRunningState GetMySqlState()
        {
            return MySqlRunningState.NotInstalled;
        }

        [WebMethod]
        public People[] GetPeople()
        {
            Log.WriteInfo("WebMethod GetPeople was invoked!");

            return new People[]{
             new People(){ Age=20, Name="陈赟喆"},
             new People(){ Age=19, Name="陈燕"},
             new People(){ Age=18, Name="xumeng"},
             new People(){ Age=19, Name="刘凡"},
             new People(){ Age=1, Name="陈梦儿"},
             
            };
        }


        [WebMethod]
        public Version GetVersion()
        {
            return null;
        }
    }

    public enum MySqlRunningState
    {
        NotInstalled,
        Running,
        Stopped,
        Hang,
    }

    [Serializable]
    public class People
    {
        public int Age { get; set; }
        public string Name { get; set; }
    }
}
